package aishua.com.mytestapplist;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;


import com.viewpagerindicator.TabPageIndicator;

import java.util.ArrayList;
import java.util.List;

import aishua.com.mytestapplist.fregment.ArcFregment;
import aishua.com.mytestapplist.fregment.CircleFregment;
import aishua.com.mytestapplist.fregment.ColorFregment;
import aishua.com.mytestapplist.fregment.HistogramFregment;
import aishua.com.mytestapplist.fregment.PiechartFregment;
import aishua.com.mytestapplist.fregment.RectFregment;
import aishua.com.mytestapplist.hencoder.HencoderAdapter;

/**
 * Created by aishua on 2017/9/21.
 */

public class HenCoderActivity extends FragmentActivity {

    private ViewPager mPager;
    private TabPageIndicator mIndicator;
    private Context mContext;
    private List<Fragment> mViewList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_hencoder);

        mPager = (ViewPager) findViewById(R.id.pager);

        mContext = this.getApplication();
        mViewList = new ArrayList<>();
        mViewList.clear();
        mViewList.add(new ColorFregment());
        mViewList.add(new CircleFregment());
        mViewList.add(new RectFregment());
        mViewList.add(new ArcFregment());
        mViewList.add(new HistogramFregment());
        mViewList.add(new PiechartFregment());
        HencoderAdapter mAdapter = new HencoderAdapter(getSupportFragmentManager(),mViewList);
        mPager.setAdapter(mAdapter);

        mIndicator = (TabPageIndicator) findViewById(R.id.indicator);
//        mIndicator.setViewPager(mPager);


    }

    @Override
    protected void onResume() {
        super.onResume();


    }

}
